Example - Beginner 5x5 modified

(inspired by stronglifts)

This notebook shows features of streprogen, the Python strength program generator.

Contributions to the code are welcome. :)

[1]:
!pip install streprogen matplotlib --quiet

Imports

[2]:
from streprogen import Program, reps_to_intensity, progression_diffeq
import matplotlib.pyplot as plt
import functools

Choose level of non-linearity

By default, streprogen introduces a little non-linearity in the general strength progression, see below.

[3]:
plt.figure(figsize=(8, 4))
plt.title("Relationship between weeks and general strength progression")

duration = 12
weeks = list(range(1, duration + 1))

for k in range(0, 4):
    progression = functools.partial(progression_diffeq, k=k)
    plt.plot(weeks, progression(weeks, start_weight=100, final_weight=120,
                                start_week=1, final_week=12), '-o', label="k=" + str(k))

plt.xlabel("Weeks"); plt.ylabel("Weight")
plt.grid(); plt.legend(); plt.tight_layout()
../_images/examples_Beginner_5x5_modified_6_0.png

You can choose the non-linearity used below. Setting k=0 removes all non-linearity.

[4]:
# Setting k=0 means linear progression.
# The default value is slightly higher than 0.
k = 1
progression = functools.partial(progression_diffeq, k=k)

Program setup

Below is the code creating the program.

  • We modify the 5x5 scheme by allowing reps to be between 4 and 6.
  • The default settings will add some some periodicity to the number of reps and the intensity over the weeks.
[5]:
# Increase in percentage per week. If set to 1.5, it takes you from 100kg to 103kg in 2 weeks.
# Here day A and B are cycled with 3 workouts per week, so we set it to a reasonably low value.
percent_inc_per_week = 1.4

program = Program(
    # The name of the training program
    name='Beginner5x5modified',
    # The duration of the training program in weeks.
    # Here day A and B are cycled with 3 workouts per week, so the duration would be ~8 weeks
    duration=12,
    # The baseline number of repetitions per dynamic exercise.
    reps_per_exercise=22,
    min_reps=3,
    max_reps=7,
    percent_inc_per_week=percent_inc_per_week,
    # The baseline intensity value (approx 82 %)
    intensity=reps_to_intensity(5),
    # Units for the weights, typically 'kg', 'lbs' or '' (empty)
    units='kg',
    # What the weights are rounded to.
    round_to=2.5,
    # Override the default progression function with out own
    progression_func=progression

)

# --------------------------------------------------
# ---- INPUT YOUR OWN 1RMs AS START WEIGHTS BELOW --
# ---- Carefully assess the program, then go back --
# ---- and adjust further if necessary.           --
# --------------------------------------------------

with program.Day("A"):
    program.DynamicExercise(name="Squat", start_weight=80)

    program.DynamicExercise(name="Bench Press", start_weight=60)

    program.DynamicExercise(name="Barbell Row", start_weight=50)

with program.Day("B"):
    program.DynamicExercise(name="Squat", start_weight=80)

    program.DynamicExercise(name="Overhead Press", start_weight=40)

    # Notice the additional `reps=5` here, constraining this exercise to a single set.
    # This overrides the `reps_per_exercise=25` parameter in the program for this exercise.
    program.DynamicExercise(name="Deadlift", start_weight=80, reps=5)

Render the program

[6]:
# Do the computations and render a program. Might take a few seconds.
program.render()

Export the program as .html or .tex, then to .pdf

A .html file can be printed directly from your browser, or printed to a .pdf from your browser.

[8]:
# Save the program as a HTML file
with open('Beginner5x5modified.html', 'w', encoding='utf-8') as file:
    # Control table width (number of sets) by passing the 'table_width' argument
    file.write(program.to_html(table_width=8))
[ ]:
# Save the program as a TEX file
with open('Beginner5x5modified.tex', 'w', encoding='utf-8') as file:
    # Control table width (number of sets) by passing the 'table_width' argument
    file.write(program.to_tex(table_width=8))

Use a .tex to generate .pdf if you have LaTeX installed, or use:

[ ]:
# If you have LaTeX installed on your system, you can render a program to .tex
# Alternatively, you can paste the LaTeX into: https://latexbase.com/
print(program.to_tex(table_width=8))